import type { PropType } from 'vue'
import type {
  EasyProTableColumn,
  PaginationProps,
  EasyProTableOptions,
  EasyProTableToolbar
} from './types'

export default {
  searchForm: {
    required: false,
    type: Object as PropType<Record<string, any>>,
    default: () => {}
  },
  pagination: {
    required: false,
    type: Object as PropType<PaginationProps>,
    default: () => ({
      pageSize: 10,
      currentPage: 1,
      layout: 'prev, pager, next',
      total: 0,
      align: 'right'
    })
  },
  data: {
    required: true,
    type: Array as PropType<Record<string, any>[]>,
    default: () => []
  },
  columns: {
    required: true,
    type: Array as PropType<EasyProTableColumn[]>,
    default: () => []
  },
  options: {
    type: Object as PropType<EasyProTableOptions>,
    default: () => {
      return {
        searchLayout: { span: 6, gutter: 20 }
      }
    }
  },
  toolbar: {
    type: [Boolean, Object] as PropType<EasyProTableToolbar>,
    default: () => false
  }
}
